<?php

declare(strict_types=1);

namespace App\Model\Payment;

use Hyperf\DbConnection\Model\Model;

/**
 * @property int $id 
 * @property string $order_sn 
 * @property int $amount 
 * @property string $subject 
 * @property string $items 
 * @property string $pay_method 
 * @property int $state 
 * @property string $out_trade_no 
 * @property int $create_time 
 * @property int $payment_time 
 * @property int $produce_time 
 * @property int $cancel_time 
 */
class PayRecord extends Model
{
    public bool $timestamps = false;
    const STATE_INIT = 0;
    const STATE_PAID = 1;
    const STATE_CANCEL = -1;

    const PAYMENT_ALIPAY= "alipay";
    const PAYMENT_WECHAT= "wechat";
    const PAYMENT_UNIPAY= "unipay";
    /**
     * The table associated with the model.
     */
    protected ?string $table = 'pay_record';

    /**
     * The attributes that are mass assignable.
     */
    protected array $fillable = ["order_sn","amount","subject","items","pay_method","state","out_trade_no","create_time","payment_time","produce_time","cancel_time"];


    /**
     * The attributes that should be cast to native types.
     */
    protected array $casts = ['id' => 'integer', 'amount' => 'integer', 'state' => 'integer', 'create_time' => 'integer', 'payment_time' => 'integer', 'produce_time' => 'integer', 'cancel_time' => 'integer'];
}
